<script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js" ></script>
<script type="text/javascript">

    $(document).ready(function() {
        $("#id_member").change(function() {
            document.getElementById("nmember").value = 'Wait...';

            var member_id = $("#id_member").val();
            //alert(member_id);
            $.ajax({
                // alert(member_id);
                url: "<?php echo Yii::app()->createUrl('/Login/CekMember'); ?>",
                data: "m=" + member_id,
                success: function(data) {

                    document.getElementById("nmember").value = data;

                }
            });
        });
    });

    function notif_activation() {
        var id = $("#id_member").val();
        var nama = $("#nmember").val();

        var c = confirm("Apakah anda yakin akan melakukan aktivasi dengan ID " + id + " dan Nama " + nama);
        //alert(c);
        if (c == true) {
            return true;
            //alert('woyoy');
        } else {
            return false;
        }
    }

</script>

<div id="content" class="clearfix">
    <h2>Form Perpanjangan Masa Aktif</h2>
    <div class="info">
<?php echo Yii::app()->user->getFlash('success'); ?>
    </div>

    <?php
    $form = $this->beginWidget('CActiveForm', array(
//        'id' => 'login-form',
        'enableClientValidation' => true,
        //'focus' => array($model, 'Member'),
        'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
    ));
    ?>
    <?php
    date_default_timezone_set("Asia/Jakarta");
    ?> 

    <?php //echo $form->error($model, 'id_member', array('style' => 'color:#a42a27;'));  ?>
    <?php //echo $form->error($model, 'verifyCode', array('style' => 'color:#a42a27;'));  ?>
<?php echo $form->hiddenField($model, 'member_activation_request_datetime', array('autocomplete' => 'off', 'value' => date("Y-m-d H:i:s"))); ?>
    <table width="100%" class="table-common">
        <tr class="even">
            <th colspan="2">Silakan mengisi form perpanjangan masa aktif dibawah ini</th>
        </tr>
        <tr valign="top" class="even">
            <td width="130" align="right"><label for="member_activation_request_network_id">ID Member</label></td>
            <td><input type="text" id="id_member" name="id_member"></td>
<?php //echo $form->textField($model, 'member_activation_request_network_id', array('autocomplete' => 'off', 'style' => 'text-transform: uppercase;'));    ?>
        </tr>
        <tr valign="top" class="even">
            <td width="130" align="right"><label for="nama member">Nama Member</label></td>
            <td><input type="text" disabled="" id="nmember" name="nama_member"></td>
<?php //echo $form->textField($model, 'member_activation_request_network_id', array('autocomplete' => 'off', 'style' => 'text-transform: uppercase;'));    ?>
        </tr>

        <tr>
            <td align="right"><label for="jumlah">Jumlah</label></td>
            <td>
                <?php
                echo $form->DropDownList($model, 'member_activation_request_quantity', array(
                    '1' => '1 Tahun',
                    '2' => '2 Tahun',
                    '3' => '3 Tahun',
                    '4' => '4 Tahun',
                    '5' => '5 Tahun',
                ));
                ?>
            </td>
        </tr>
        <tr></tr>
        <tr valign="top" class="even">
            <td align="right" style="vertical-align: top;"><label for="keterangan">Keterangan</label></td>
            <td><?php echo $form->textArea($model, 'member_activation_request_note', array('cols' => '50', 'rows' => '5')); ?></td>     
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
                <input name="yto" class="btn-kirim" onclick="return notif_activation();" value="" type="submit" />
            </td>
        </tr>
    </table>     
<?php $this->endWidget(); ?>
</div>
